package cn.cdeden.knowledge.domain;

import cn.cdeden.knowledge.domain.dto.SysCalendarDto;
import cn.cdeden.knowledge.domain.dto.SysCalendarSharingDto;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
//import io.swagger.annotations.ApiModelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
* @author Guojunxu
* @date 2024-04-17
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@AutoMappers({@AutoMapper(target = SysCalendarSharingDto.class)})
@TableName("sys_calendar_sharing")
public class SysCalendarSharing implements Serializable {
    private static final long serialVersionUID = 1L;

//    @ApiModelProperty(value = "日历ID")
    @TableId(type= IdType.AUTO)
    private Long calendarId;

//    @ApiModelProperty(value = "日历共享人员ID")
    private String calendarSharingId;

    public void copyFrom(SysCalendarSharing source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
